package com.hjqjl.whdemo.feature.feature0.ui.activity;

import android.content.Context;
import android.content.Intent;
import android.view.View;
import android.view.animation.Animation;

import com.hjqjl.whdemo.base.BaseActivity;
import com.hjqjl.whdemo.databinding.ActivityWelcomeBinding;
import com.hjqjl.whdemo.utils.AnimationUtils;

public class WelcomeActivity extends BaseActivity {
    public static void start(Context context) {
        Intent starter = new Intent(context, WelcomeActivity.class);
        context.startActivity(starter);
    }

    private ActivityWelcomeBinding binding;

    @Override
    protected void initData() {
        binding = ActivityWelcomeBinding.inflate(getLayoutInflater());
        View view = binding.getRoot();
        setContentView(view);
    }

    @Override
    protected void processLogic() {
        Animation animation = AnimationUtils.getAmplificationAnimation(2000, new Animation.AnimationListener() {
            @Override
            public void onAnimationStart(Animation animation) {

            }

            @Override
            public void onAnimationEnd(Animation animation) {
                finish();
            }

            @Override
            public void onAnimationRepeat(Animation animation) {

            }
        });
        binding.ivWelcomeBg.startAnimation(animation);
    }
}
